1. Field of the Invention
The present invention relates to a motion detection method, and more particularly, to a motion detection method for abstracting multiple moving objects and increasing detection accuracy.
2. Description of the Prior Art
Digital video recordings (DVR), which have functions of monitoring, video, playing, far-end control, and so on, are popular applications. The digital video recordings use a frame generator to photograph image frames and then store the image frames into a computer after a compression process. Since image compression technology is being developed rapidly, for example, MPEG4 has successfully been used in the digital video recordings, people can use limited hard disc capacity of computers to store the image frames for several weeks or one year. The digital video recordings are gradually replacing old closed circuit televisions (CCTV). Since the digital video recordings use storage media (such as hard discs) to store the image frames, they do not have problems such as mildew, forgetting to switch to a new video, and difficult management of the videos, as was the case of the closed circuit televisions. Moreover, the image data are digital data, so that the image data can be quickly transmitted to distant places through a network, thereby decreasing the transmission time. People in the distant places can receive the image data fast. In addition, the digital image data can be further processed. For example, the digital video recordings always have a monitor and an alarm, so that the digital video recordings can perform the monitor operation through the digital signal. The digital video recordings determine whether an object is moving according to the computer operation, so as to generate a corresponding warning signal.
A prior art detection method uses a calculating device to compare a plurality of image frames generated by a frame generator so as to determine whether an object is moving inside a scene. The calculating device compares a first image frame with a successive second image frame inside the plurality of image frames so as to determine whether the object is moving inside the scene. In general, when the object is moving, a plurality of pixels inside the image frame generated by the frame generator is changed. Therefore, when comparing the first image frame with the second image frame, the calculating device can use a change of the plurality of pixels inside the first and second image frame to be a judge criterion. That means when the plurality of pixels of the image frame are changed, the calculating device can determine whether something is moving inside the scene according to the first image frame and the second image frame.
Please refer to FIG. 1 and FIG. 2. FIG. 1 is a perspective view of a prior art detecting system 50. FIG. 2 is a block diagram of the prior art detecting system 50. As mentioned above, the detecting system 50 determines whether something is moving inside a scene 52 according to a predetermined detection method. The detecting system 50 comprises a frame generator 20 and a calculating device 30. The frame generator 20 is used to periodically picture the scene 52 according to a predetermined period (30 times per second) to generate a plurality of image frames 22. The calculating device 30 is used to process a first image frame 24 and a second image frame 26 inside the plurality of image frames 22, and compare the first image frame 24 with the second image frame 26 according to the predetermined detecting method so as to determine whether something is moving inside the scene 52. The calculating device 30 compares each pixel of the second image frame 26 with the corresponding pixel of the first image frame 24, and determines whether the second image frame 26 is changed from the first image frame 24 according to a threshold value. The calculating device 30 calculates a difference value between each pixel of the first image frame and the second image frame, and determines whether the difference value is larger than the threshold value. If the difference value of the pixels is larger than the threshold value, that means the moving object is moving inside the scene 52. However, if the threshold value is set too small, mixed signals generated inside the second image frame, 26 or little changes generated when the moving object moves are seen as a portion of the moving object. Therefore, an abstracting range generated by the calculating device 30 is larger than a real size of the moving object. If the threshold value is set too high, small movements generated by the moving object are not detected in the second image frame 26. Therefore, the real size of the moving object is unable to be abstracted by the detecting system 50. The detecting system 50 generates a small moving area of the moving object according to the high threshold value, and an error rate while using the high threshold value is low. Conversely, the detecting system 50 generates a large moving area of the moving object according to the small threshold value. The error rate while using the small threshold value is high. Whether using the high threshold value or the small threshold value, the detecting system 50 also easily generates incorrect detections. Therefore, the prior art detecting system 50 is easily influenced by the single threshold value to generate incorrect detections.
In addition, the moving object can be seen as moving inside a stationary background. However, a portion of the background is sheltered by the moving object. When the moving object is moving, the sheltered background will appear again. Therefore, the sheltered background in the first image frame 24 will appear in the second image frame 26. The sheltered background is considered to be a portion of the moving object or to be another moving object. Actually, the sheltered background does not execute any movement. For example, a passerby is walking along a passageway. The passageway is the fixed background. A vase is put on the passageway. When the passageway is walking on the front of the vase, since the vase is sheltered by the passerby, the vase does not appear on the first image frame 24. When the passerby leaves from in front of the vase, both the vase and the passerby appear on the second image frame 26. Then the second image frame 26 is compared with the first image frame 24. Since the pixels corresponding to the vase and passerby in the second image frame 26 are different from the corresponding pixels in the first image frame 24, both the vase and the passerby are considered to be the moving area. However, the vase is a portion of the background and does not generate any movement. The detecting system 50 performs incorrect detection in considering the vase as the moving area and abstracting the image of the vase. The detecting system 50 is unable to differentiate between the moving object and the background. When a plurality of moving objects move inside the background, the detecting system 50 determines that there are a plurality of moving areas inside an image frame 22. The images corresponding to a part of the moving areas are the moving objects, but images corresponding to other parts of the moving areas are the background. Therefore, the detecting system 50 is unable to abstract the moving objects correctly.